Skip to content

feat: add SubsetSum → Partition reduction (#973) [full pipeline]#989

Closed
zazabap wants to merge 2 commits intomainfrom
feat/973-subsetsum-partition
Closed

feat: add SubsetSum → Partition reduction (#973) [full pipeline]#989
zazabap wants to merge 2 commits intomainfrom
feat/973-subsetsum-partition

Conversation

@zazabap
Copy link
Copy Markdown
Collaborator

@zazabap zazabap commented Apr 1, 2026

Summary

SubsetSum → Partition via the full /verify-reduction/add-reduction pipeline.

3-case padding construction: Σ=2T (no padding), Σ>2T (d=Σ-2T), Σ<2T (d=2T-Σ).
This gives Partition its first incoming reduction, connecting it to the reduction graph.

Pipeline

Issue #973 → /verify-reduction (PR #981: 284K checks, 0 failures)
           → type gate: Or→Or ✓
           → test vectors JSON exported
           → /add-reduction (this PR)
             → Rust impl (3-case reduce_to + extract_solution)
             → 5 tests from test vectors (closed-loop, infeasible, structure, d=0, Σ<2T)
             → canonical example in rule_builders.rs
             → example-db coverage gate passing
             → verification artifacts cleaned up

Files

  • src/rules/subsetsum_partition.rs — reduction (+160 lines)
  • src/unit_tests/rules/subsetsum_partition.rs — 5 tests (+90 lines)
  • docs/paper/verify-reductions/ — artifacts removed (-6003 lines)

Net: +252 / -6003 lines (artifacts are scaffolding, only Rust remains)

Test plan

  • cargo test subsetsum_to_partition — 5/5 pass
  • cargo clippy — clean
  • example-db coverage gate passing (29/29 tests)
  • Full test suite: 4357+ tests, 0 failures

Closes #973

🤖 Generated with Claude Code

zazabap and others added 2 commits April 1, 2026 06:56
Typst: 3-case construction (Σ=2T, Σ>2T, Σ<2T) + Correctness (⟹ + ⟸) + Extraction + Overhead + YES/NO examples
Constructor: 47,233 checks, 0 failures (exhaustive n ≤ 5, 7 sections)
Adversary: 236,283 checks, 0 failures (independent impl + hypothesis)
Cross-comparison: 690 instances, all agree

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implemented via /verify-reduction -> /add-reduction pipeline.
3-case padding construction (Sigma=2T, Sigma>2T, Sigma<2T).
Verification: 284K+ Python checks preceded this Rust impl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 97.54098% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.03%. Comparing base (423506c) to head (c3c417b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/rules/subsetsum_partition.rs 95.94% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #989    +/-   ##
========================================
  Coverage   98.03%   98.03%            
========================================
  Files         784      786     +2     
  Lines       82310    82432   +122     
========================================
+ Hits        80695    80815   +120     
- Misses       1615     1617     +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zazabap zazabap closed this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Rule] SUBSET SUM to PARTITION

1 participant